<template>
    <div id="OrdersTitle">
        <v-details :inputConfig="inputConfig" :detailData="inputData" :rules="rules" ref="input"></v-details>
    </div>
</template>

<script>
    import details from 'commons/Detail'
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        props: {
            inputData: {
                type: Object,
            }
        },
        mixins: [baseMixin],
        name: "OrdersTitle",
        data() {
            return {
                rules: {
                    shippingkey: [
                        {required: true, trigger: 'blur'},
                    ]
                },
                addflag: false,
            }
        },
        computed: {
            inputConfig() {
                return [
                    [
                        {
                            type: "input",
                            label: this.$t('out.shippingkey'),
                            disabled: true,
                            props: "shippingkey",
                        },
                        {
                            type: "input",
                            label: this.$t('out.totalqty2'),
                            disabled: true,
                            props: "totalqty",
                        },
                        {
                            type: "input",
                            label: this.$t('out.boxnumber2'),
                            disabled: true,
                            props: "boxnumber"
                        },
                        {
                            type: "input",
                            label: this.$t('out.totalcube1'),
                            disabled: true,
                            props: "totalcube"
                        }
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('config.carrier'),
                            disabled: true,
                            props: "carriercode"
                        },
                        {
                            type: "select",
                            label: this.$t('common.status'),
                            disabled: true,
                            props: "status",
                            options: this.getOptions("querycodeLkup/RTXSHSTATU")
                        },
                        {
                            type: "select",
                            label: this.$t('out.shiptype'),
                            disabled: true,
                            props: "type",
                            options: this.getOptions("querycodeLkup/RTXSHIPTYPE")
                        },
                        {
                            type: "input",
                            label: this.$t('out.ordernumber1'),
                            disabled: true,
                            props: "ordernumber"
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('app.addName'),
                            disabled: true,
                            props: "addwho"
                        },
                        {
                            type: "date",
                            label: this.$t('app.addDate'),
                            disabled: true,
                            props: "adddate"
                        },
                        {
                            type: "input",
                            label: this.$t('app.updateName'),
                            disabled: true,
                            props: "editwho"
                        },
                        {
                            type: "date",
                            label: this.$t('app.updateDate'),
                            disabled: true,
                            props: "editdate"
                        },
                    ],
                ]
            }
        },
        methods: {},
        mounted() {
            if (Object.keys(this.$store.state.skip).length!==0) {
                let data = this.$store.state.skip;
                this.addflag = data.newFlag;
            } else if (!this.$store.state.newFlag) {
                this.addflag = true;
            }
        },
        watch: {},
        components: {
            'v-details': details
        }
    }
</script>

<style scoped>

</style>
